import java.util.Scanner;

public class test15 {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        int flag = in.nextInt(); // 数组长度
        int[] arr =  new int[flag];
        int num = in.nextInt(); // 要插入的数
        for (int i = 0; i < flag; i++) {
            arr[i] = in.nextInt();
        }
        System.out.println(searchInsert(arr,num));
    }

    public static int searchInsert (int[] nums, int target){
        int left = 0;
        int right = nums.length-1;
        int mid = 0;
        while(left<=right){
            mid = left+(right-left) / 2; // 中间点
            if(nums[mid] == target)
                return mid;
            else if (nums[mid]>target) {
                right = mid-1;
            }else
                left = mid+1;
        }
        return left;
    }
}
